import grace from "../../utils/grace.js"
grace.page({
      data: {
            stores: []
      },
      onLoad: function(options) {
            this.loadData();
      },
      loadData: function() {
            this.$http.get('api/home/store_self_list', {}).then((res) => {
                  this.$data.stores = res.list;
            });
      },
      setDefault: function(e) {
            let idx = e.currentTarget.dataset.idx;
            let store = this.$data.stores[idx];
            if (store) {
                  this.$goBack({
                        store: store
                  });
            }
      }
})